import { cloneDeep } from 'lodash';
import audioPlayerCompImg from '@/visual/assets/img/dashboard/audio-player-comp.png';
import { visualComponentConfig, visualComponentGroup } from './base-config';
import { mediaPreloadConst, mediaSourceConst } from '@/visual/commons/consts/dashboard-const';
import CommonUtil from '@/visual/commons/utils/common-util';




/**
 * H5音频播放器
 */
const audioPlayerCompConfig = {
  key: 'fd80d6e94ddd',
  compId:'hvAudioPlayer'+CommonUtil.shortUUID(),
  name: 'hvAudioPlayer',
  group: visualComponentGroup.base.value,
  label: 'H5音频播放器',
  img: audioPlayerCompImg,
  propertyComponent: 'hvAudioPlayerProperty',
  componentStyleGeneratorName: 'hvCommonStyleGenerator',
  ...cloneDeep(visualComponentConfig.options),
  componentDimensions: {
    width: 500,
    height: 100,
  },
  componentProps: {
    sourceList: [
      {
        src: '',
        sourceType: mediaSourceConst.url,
      },
    ],
    autoplay: false,
    controls: true,
    loop: true,
    muted: false,
    preload: mediaPreloadConst.none,
  },
};


/**
 * 配置 
 */
export {
  audioPlayerCompConfig
}